package com.sky.web.data2.menu.controller;

import javax.annotation.Resource;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.sky.web.data2.menu.entity.Operate;
import com.sky.web.data2.menu.service.OperateService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

@RestController
@Api(description = "data1-data2测试分布式事务")
public class OperateController {
	@Resource
	private OperateService operateService;
	
	@ApiOperation(value = "测试分布式事务-添加用户菜单")
	@ApiImplicitParams({
		@ApiImplicitParam(name = "id" , value = "id" , paramType = "query" , required = true ),
		@ApiImplicitParam(name = "userName" , value = "userName" , paramType = "query" , required = true ),
		@ApiImplicitParam(name = "pwd" , value = "pwd" , paramType = "query" , required = true ),
		@ApiImplicitParam(name = "menuName" , value = "menuName" , paramType = "query" , required = true ),
		@ApiImplicitParam(name = "url" , value = "url" , paramType = "query" , required = true )
	})
	@RequestMapping(value="/testTx", method = RequestMethod.POST)
	public String testTx(Operate operate){
		operateService.testTx(operate);
		return "success";
	}

}
